using System;
using System.Collections.Generic;
using System.Text;

using Impact.Model.Objects;

namespace Impact.Model.Service
{
    /// <summary>
    /// defines the functions available from the service providing plugin data
    /// </summary>
    public interface IPluginService
    {
        /// <summary>
        /// retrieves a plugin based on its registration ID
        /// </summary>
        PagePlugin FetchByID(int registrationId);

        /// <summary>
        /// retrieves all the plugins associated with the given page
        /// </summary>
        PagePluginCollection FetchByPage(int pageId);

        /// <summary>
        /// retrieves all the plugins associated with the given page at a given location
        /// </summary>
        PagePluginCollection FetchByPageByLocation(int pageId, int location);

        /// <summary>
        /// creates a new reference for a given plugin on a given page
        /// </summary>
        /// <param name="pageId">ID of the page to add the plugin to</param>
        /// <param name="pluginId">GUID of the plugin to add to the page</param>
        /// <param name="userId">ID of the user responsible for the change</param>
        void Add(int pageId, Guid pluginId, Guid userId);

        /// <summary>
        /// remove the reference of the plugin on a page
        /// </summary>
        void Remove(int registrationId);

        /// <summary>
        /// saves the plugin object and its associated parameters
        /// </summary>
        void Save(PagePlugin plugin, Guid userId);

        /// <summary>
        /// saves a group of plugins
        /// </summary>
        void Save(PagePluginCollection plugins, Guid userId);

    }
}
